package com.sync.data.mce.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.sync.data.base.BaseEntity;
import com.sync.data.common.annotation.FieldProps;
import com.sync.data.common.annotation.FieldType;
import com.sync.data.common.annotation.RenderType;
import com.sync.data.common.obj.annoation.ObjectPrefix;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * 客户对象
 *
 * @author liquanchang
 */

@Getter
@Setter
@Entity
@ObjectPrefix("bpem")
@Table(name = "base_position_employee")
public class MceBasePositionEmployee extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 岗位ID
     */
    @FieldProps(type = FieldType.STRING, label = "岗位ID", sourceObject = "BasePosition", renderField = "basePosition", renderType = RenderType.SourcePicker)
    private String positionId;
    /**
     * 员工ID
     */
    @FieldProps(type = FieldType.STRING, label = "员工", sourceObject = "BaseEmployee", renderField = "baseEmployee", renderType = RenderType.SourcePicker)
    private String empId;
    /**
     * 员工编号
     */
    @FieldProps(type = FieldType.STRING, label = "员工编号")
    private String empCode;

    @FieldProps(type = FieldType.STRING, label = "员工姓名")
    private String empName;

    @FieldProps(type = FieldType.STRING, label = "是否删除")
    private String delFlag;

    @FieldProps(type = FieldType.STRING, label = "是否生效")
    private Integer isActive ;

    @FieldProps(type = FieldType.STRING, label = "是否主岗")
    private Integer isMain;


    @FieldProps(type = FieldType.STRING, label = "开始时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private Date beginDate;


    @FieldProps(type = FieldType.STRING, label = "结束时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endDate;


    /**
     * 岗位编号
     */
    @FieldProps(type = FieldType.STRING, label = "岗位编号")
    private String positionCode;

    public MceBasePositionEmployee(String id, String positionId, String empId, String empCode, Date beginDate, Date endDate) {
        this.id = id;
        this.empId = empId;
        this.empCode = empCode;
        this.positionId = positionId;
        this.beginDate = beginDate;
        this.endDate = endDate;
    }

    public MceBasePositionEmployee() {
    }


    public MceBasePositionEmployee(String id, String positionId, String positionCode, String empCode, String empName) {
        this.id = id;
        this.positionId = positionId;
        this.positionCode = positionCode;
        this.empCode = empCode;
        this.empName = empName;
    }
}
